<?php

namespace fastflow\driver\think;

use fastflow\driver\interfaces\cancheckIndexTemplate;
use think\Db;

class cancheckIndex implements cancheckIndexTemplate
{

    public static function addCancheckIndex($param)
    {
        if (isset($param)) {
            $count = Db::table('__FASTFLOW_CANCHECK_INDEX__')->insert($param);
            return $count;
        }
        return false;
    }

    public static function getCancheckIndex($param)
    {
        if (isset($param)) {
            $cancheckIndex = Db::table('__FASTFLOW_CANCHECK_INDEX__')->where($param)->select();
            if (count($cancheckIndex) == 0) {
                return false;
            }
            return $cancheckIndex;
        }
        return false;
    }

    public static function delCancheckIndex($param)
    {
        if (isset($param)) {
            $count = Db::table('__FASTFLOW_CANCHECK_INDEX__')->where($param)->delete();
            return $count;
        }
        return false;
    }

}